home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / tcl / xf2.3-p / xf2 / xf2.3 / src / xfoptSource.tcl < prev    next >
Encoding:
Text File  |  1993-11-20  |  14.6 KB  |  463 lines

  1. # Program: xf
  2. # Description: the option dialog for general options
  3. #
  4. # $Header: xfoptSource.tcl[2.3] Wed Mar 10 12:07:22 1993 garfield@garfield frozen $
  5.  
  6. ##########
  7. # Procedure: XFOptionsSource
  8. # Description: allow the editing of the source options
  9. # Arguments: none
  10. # Returns: none
  11. # Sideeffects: none
  12. ##########
  13. proc XFOptionsSource {} {
  14.   global xfBindSaveLevel
  15.   global xfComment
  16.   global xfConf
  17.   global xfMisc
  18.   global xfProcSaveLevel
  19.   global xfStatus
  20.  
  21.   set xfMisc(encloseBinding) $xfConf(encloseBinding)
  22.   set xfMisc(encloseConfigure) $xfConf(encloseConfigure)
  23.   set xfMisc(createAppdefCode) $xfConf(createAppdefCode)
  24.   set xfMisc(createClassBinding) $xfConf(createClassBinding)
  25.   set xfMisc(createFormCode) $xfConf(createFormCode)
  26.   set xfMisc(createParseCode) $xfConf(createParseCode)
  27.   set xfMisc(createPixmapCode) $xfConf(createPixmapCode)
  28.   set xfMisc(newPacker) $xfConf(newPacker)
  29.   set xfMisc(writeShellScript) $xfConf(writeShellScript)
  30.   set xfMisc(writeTclIndex) $xfConf(writeTclIndex)
  31.   set xfMisc(writeNewTclIndex) $xfConf(writeNewTclIndex)
  32.   set xfMisc(commentfile) $xfComment(file)
  33.   set xfMisc(commentmodule) $xfComment(module)
  34.   set xfMisc(commentproc) $xfComment(proc)
  35.   set xfMisc(commenttemplate) $xfComment(template)
  36.   set xfMisc(bindSaveLevel1) $xfBindSaveLevel(1)
  37.   set xfMisc(bindSaveLevel2) $xfBindSaveLevel(2)
  38.   set xfMisc(bindSaveLevel3) $xfBindSaveLevel(3)
  39.   set xfMisc(bindSaveLevel4) $xfBindSaveLevel(4)
  40.   set xfMisc(bindSaveLevel5) $xfBindSaveLevel(5)
  41.   set xfMisc(bindSaveLevel6) $xfBindSaveLevel(6)
  42.   set xfMisc(bindSaveLevel7) $xfBindSaveLevel(7)
  43.   set xfMisc(bindSaveLevel8) $xfBindSaveLevel(8)
  44.   set xfMisc(procSaveLevel1) $xfProcSaveLevel(1)
  45.   set xfMisc(procSaveLevel2) $xfProcSaveLevel(2)
  46.   set xfMisc(procSaveLevel3) $xfProcSaveLevel(3)
  47.   set xfMisc(procSaveLevel4) $xfProcSaveLevel(4)
  48.   set xfMisc(procSaveLevel5) $xfProcSaveLevel(5)
  49.   set xfMisc(procSaveLevel6) $xfProcSaveLevel(6)
  50.   set xfMisc(procSaveLevel7) $xfProcSaveLevel(7)
  51.   set xfMisc(procSaveLevel8) $xfProcSaveLevel(8)
  52.  
  53.   # build widget structure
  54.   XFTmpltToplevel .xfOptionsSource 400x560 {XF source options}
  55.  
  56.   XFTmpltFrame .xfOptionsSource.frame1 0
  57.  
  58.   button .xfOptionsSource.frame1.ok \
  59.     -text {OK} \
  60.     -command {
  61.       XFOptionsSourceSet
  62.       destroy .xfOptionsSource}
  63.  
  64.   button .xfOptionsSource.frame1.save \
  65.     -text {Save + OK} \
  66.     -command {
  67.       XFOptionsSourceSet
  68.       XFProcOptionsSaveOptions
  69.       destroy .xfOptionsSource}
  70.  
  71.   button .xfOptionsSource.frame1.cancel \
  72.     -text {Cancel} \
  73.     -command {destroy .xfOptionsSource}
  74.  
  75.   XFTmpltFrame .xfOptionsSource.frame2
  76.  
  77.   checkbutton .xfOptionsSource.frame2.appdef \
  78.     -offvalue 0 \
  79.     -onvalue 1 \
  80.     -text {Create application default code} \
  81.     -variable xfMisc(createAppdefCode)
  82.  
  83.   checkbutton .xfOptionsSource.frame2.form \
  84.     -offvalue 0 \
  85.     -onvalue 1 \
  86.     -text {Create form support code} \
  87.     -variable xfMisc(createFormCode)
  88.  
  89.   checkbutton .xfOptionsSource.frame2.parse \
  90.     -offvalue 0 \
  91.     -onvalue 1 \
  92.     -text {Create commandline parsing code} \
  93.     -variable xfMisc(createParseCode)
  94.  
  95.   checkbutton .xfOptionsSource.frame2.preload \
  96.     -offvalue 0 \
  97.     -onvalue 1 \
  98.     -text {Create pixmap preloading code} \
  99.     -variable xfMisc(createPixmapCode)
  100.  
  101.   checkbutton .xfOptionsSource.frame2.classbind \
  102.     -offvalue 0 \
  103.     -onvalue 1 \
  104.     -text {Create class bindings} \
  105.     -variable xfMisc(createClassBinding)
  106.  
  107.   checkbutton .xfOptionsSource.frame2.newpacker \
  108.     -offvalue 0 \
  109.     -onvalue 1 \
  110.     -text {Create new packer code} \
  111.     -variable xfMisc(newPacker)
  112.  
  113.   checkbutton .xfOptionsSource.frame2.tclindex \
  114.     -offvalue 0 \
  115.     -onvalue 1 \
  116.     -text {Create tclIndex file} \
  117.     -variable xfMisc(writeTclIndex)
  118.  
  119.   checkbutton .xfOptionsSource.frame2.newtclindex \
  120.     -offvalue 0 \
  121.     -onvalue 1 \
  122.     -text {Create new style tclIndex file} \
  123.     -variable xfMisc(writeNewTclIndex)
  124.  
  125.   checkbutton .xfOptionsSource.frame2.script \
  126.     -offvalue 0 \
  127.     -onvalue 1 \
  128.     -text {Create shell script} \
  129.     -variable xfMisc(writeShellScript)
  130.  
  131.   XFTmpltFrame .xfOptionsSource.frame3
  132.  
  133.   XFTmpltFrame .xfOptionsSource.frame3.frame8 0
  134.  
  135.   label .xfOptionsSource.frame3.frame8.message2 \
  136.     -borderwidth 0 \
  137.     -text {Bindings are surrounded by:}
  138.  
  139.   radiobutton .xfOptionsSource.frame3.frame8.binding1 \
  140.     -text {"..."} \
  141.     -value 0 \
  142.     -variable xfMisc(encloseBinding)
  143.  
  144.   radiobutton .xfOptionsSource.frame3.frame8.binding2 \
  145.     -text {{...}} \
  146.     -value 1 \
  147.     -variable xfMisc(encloseBinding)
  148.  
  149.   XFTmpltFrame .xfOptionsSource.frame3.frame9 0
  150.  
  151.   label .xfOptionsSource.frame3.frame9.message2 \
  152.     -borderwidth 0 \
  153.     -text {Widget parameters are surrounded by:}
  154.  
  155.   radiobutton .xfOptionsSource.frame3.frame9.config1 \
  156.     -text {"..."} \
  157.     -value 0 \
  158.     -variable xfMisc(encloseConfigure)
  159.  
  160.   radiobutton .xfOptionsSource.frame3.frame9.config2 \
  161.     -text {{...}} \
  162.     -value 1 \
  163.     -variable xfMisc(encloseConfigure)
  164.  
  165.   XFTmpltFrame .xfOptionsSource.frame4 0
  166.  
  167.   XFTmpltFrame .xfOptionsSource.frame4.frame5 0
  168.  
  169.   label .xfOptionsSource.frame4.message1 \
  170.     -relief raised \
  171.     -text {Comment layout:}
  172.  
  173.   XFTmpltText .xfOptionsSource.frame4 text 0 \
  174.     [set xfMisc(comment$xfStatus(comment))]
  175.  
  176.   radiobutton .xfOptionsSource.frame4.frame5.file \
  177.     -command {XFOptionsSourceComment} \
  178.     -text {File} \
  179.     -value file \
  180.     -variable xfStatus(comment)
  181.  
  182.   radiobutton .xfOptionsSource.frame4.frame5.module \
  183.     -command {XFOptionsSourceComment} \
  184.     -text {Module} \
  185.     -value module \
  186.     -variable xfStatus(comment)
  187.  
  188.   radiobutton .xfOptionsSource.frame4.frame5.template \
  189.     -command {XFOptionsSourceComment} \
  190.     -text {Template} \
  191.     -value template \
  192.     -variable xfStatus(comment)
  193.  
  194.   radiobutton .xfOptionsSource.frame4.frame5.proc \
  195.     -command {XFOptionsSourceComment} \
  196.     -text {Procedure} \
  197.     -value proc \
  198.     -variable xfStatus(comment)
  199.  
  200.   set xfStatus(currentComment) $xfStatus(comment)
  201.  
  202.   XFTmpltFrame .xfOptionsSource.frame7
  203.  
  204.   label .xfOptionsSource.frame7.mess \
  205.     -anchor e \
  206.     -padx 0 \
  207.     -pady 0 \
  208.     -text {Binding save levels:}
  209.  
  210.   checkbutton .xfOptionsSource.frame7.level1 \
  211.     -offvalue 0 \
  212.     -onvalue 1 \
  213.     -text {1} \
  214.     -variable xfMisc(bindSaveLevel1)
  215.  
  216.   checkbutton .xfOptionsSource.frame7.level2 \
  217.     -offvalue 0 \
  218.     -onvalue 1 \
  219.     -text {2} \
  220.     -variable xfMisc(bindSaveLevel2)
  221.  
  222.   checkbutton .xfOptionsSource.frame7.level3 \
  223.     -offvalue 0 \
  224.     -onvalue 1 \
  225.     -text {3} \
  226.     -variable xfMisc(bindSaveLevel3)
  227.  
  228.   checkbutton .xfOptionsSource.frame7.level4 \
  229.     -offvalue 0 \
  230.     -onvalue 1 \
  231.     -text {4} \
  232.     -variable xfMisc(bindSaveLevel4)
  233.  
  234.   checkbutton .xfOptionsSource.frame7.level5 \
  235.     -offvalue 0 \
  236.     -onvalue 1 \
  237.     -text {5} \
  238.     -variable xfMisc(bindSaveLevel5)
  239.  
  240.   checkbutton .xfOptionsSource.frame7.level6 \
  241.     -offvalue 0 \
  242.     -onvalue 1 \
  243.     -text {6} \
  244.     -variable xfMisc(bindSaveLevel6)
  245.  
  246.   checkbutton .xfOptionsSource.frame7.level7 \
  247.     -offvalue 0 \
  248.     -onvalue 1 \
  249.     -text {7} \
  250.     -variable xfMisc(bindSaveLevel7)
  251.  
  252.   checkbutton .xfOptionsSource.frame7.level8 \
  253.     -offvalue 0 \
  254.     -onvalue 1 \
  255.     -text {8} \
  256.     -variable xfMisc(bindSaveLevel8)
  257.  
  258.   XFTmpltFrame .xfOptionsSource.frame8
  259.  
  260.   label .xfOptionsSource.frame8.mess \
  261.     -anchor e \
  262.     -padx 0 \
  263.     -pady 0 \
  264.     -text {Procedure save levels:}
  265.  
  266.   checkbutton .xfOptionsSource.frame8.level1 \
  267.     -offvalue 0 \
  268.     -onvalue 1 \
  269.     -text {1} \
  270.     -variable xfMisc(procSaveLevel1)
  271.  
  272.   checkbutton .xfOptionsSource.frame8.level2 \
  273.     -offvalue 0 \
  274.     -onvalue 1 \
  275.     -text {2} \
  276.     -variable xfMisc(procSaveLevel2)
  277.  
  278.   checkbutton .xfOptionsSource.frame8.level3 \
  279.     -offvalue 0 \
  280.     -onvalue 1 \
  281.     -text {3} \
  282.     -variable xfMisc(procSaveLevel3)
  283.  
  284.   checkbutton .xfOptionsSource.frame8.level4 \
  285.     -offvalue 0 \
  286.     -onvalue 1 \
  287.     -text {4} \
  288.     -variable xfMisc(procSaveLevel4)
  289.  
  290.   checkbutton .xfOptionsSource.frame8.level5 \
  291.     -offvalue 0 \
  292.     -onvalue 1 \
  293.     -text {5} \
  294.     -variable xfMisc(procSaveLevel5)
  295.  
  296.   checkbutton .xfOptionsSource.frame8.level6 \
  297.     -offvalue 0 \
  298.     -onvalue 1 \
  299.     -text {6} \
  300.     -variable xfMisc(procSaveLevel6)
  301.  
  302.   checkbutton .xfOptionsSource.frame8.level7 \
  303.     -offvalue 0 \
  304.     -onvalue 1 \
  305.     -text {7} \
  306.     -variable xfMisc(procSaveLevel7)
  307.  
  308.   checkbutton .xfOptionsSource.frame8.level8 \
  309.     -offvalue 0 \
  310.     -onvalue 1 \
  311.     -text {8} \
  312.     -variable xfMisc(procSaveLevel8)
  313.  
  314.   # packing
  315.   pack append .xfOptionsSource.frame1 \
  316.               .xfOptionsSource.frame1.ok {left fill expand} \
  317.               .xfOptionsSource.frame1.save {left fill expand} \
  318.               .xfOptionsSource.frame1.cancel {left fill expand}
  319.   pack append .xfOptionsSource.frame2 \
  320.               .xfOptionsSource.frame2.appdef {top padx 10 pady 10} \
  321.               .xfOptionsSource.frame2.form {top padx 10 pady 10} \
  322.               .xfOptionsSource.frame2.parse {top padx 10 pady 10} \
  323.               .xfOptionsSource.frame2.preload {top padx 10 pady 10} \
  324.               .xfOptionsSource.frame2.classbind {top padx 10 pady 10} \
  325.               .xfOptionsSource.frame2.newpacker {top padx 10 pady 10} \
  326.               .xfOptionsSource.frame2.tclindex {top padx 10 pady 10} \
  327.               .xfOptionsSource.frame2.newtclindex {top padx 10 pady 10} \
  328.               .xfOptionsSource.frame2.script {top padx 10 pady 10}
  329.   pack append .xfOptionsSource.frame3.frame8 \
  330.               .xfOptionsSource.frame3.frame8.message2 {left fill expand} \
  331.               .xfOptionsSource.frame3.frame8.binding1 {left fill expand} \
  332.               .xfOptionsSource.frame3.frame8.binding2 {left fill expand}
  333.   pack append .xfOptionsSource.frame3.frame9 \
  334.               .xfOptionsSource.frame3.frame9.message2 {left fill expand} \
  335.               .xfOptionsSource.frame3.frame9.config1 {left fill expand} \
  336.               .xfOptionsSource.frame3.frame9.config2 {left fill expand}
  337.   pack append .xfOptionsSource.frame3 \
  338.               .xfOptionsSource.frame3.frame8 {top padx 10 pady 10} \
  339.               .xfOptionsSource.frame3.frame9 {top padx 10 pady 10}
  340.   pack append .xfOptionsSource.frame4.frame5 \
  341.               .xfOptionsSource.frame4.frame5.file {left fill expand} \
  342.               .xfOptionsSource.frame4.frame5.module {left fill expand} \
  343.               .xfOptionsSource.frame4.frame5.template {left fill expand} \
  344.               .xfOptionsSource.frame4.frame5.proc {left fill expand}
  345.   pack append .xfOptionsSource.frame4 \
  346.               .xfOptionsSource.frame4.message1 {top fill} \
  347.               .xfOptionsSource.frame4.frame5 {bottom fill} \
  348.               .xfOptionsSource.frame4.text {top fill expand}
  349.   pack append .xfOptionsSource.frame7 \
  350.               .xfOptionsSource.frame7.mess {left fill padx 10 pady 10} \
  351.               .xfOptionsSource.frame7.level1 {left fill expand} \
  352.               .xfOptionsSource.frame7.level2 {left fill expand} \
  353.               .xfOptionsSource.frame7.level3 {left fill expand} \
  354.               .xfOptionsSource.frame7.level4 {left fill expand} \
  355.               .xfOptionsSource.frame7.level5 {left fill expand} \
  356.               .xfOptionsSource.frame7.level6 {left fill expand} \
  357.               .xfOptionsSource.frame7.level7 {left fill expand} \
  358.               .xfOptionsSource.frame7.level8 {left fill expand}
  359.   pack append .xfOptionsSource.frame8 \
  360.               .xfOptionsSource.frame8.mess {left padx 10 pady 10} \
  361.               .xfOptionsSource.frame8.level1 {left fill expand} \
  362.               .xfOptionsSource.frame8.level2 {left fill expand} \
  363.               .xfOptionsSource.frame8.level3 {left fill expand} \
  364.               .xfOptionsSource.frame8.level4 {left fill expand} \
  365.               .xfOptionsSource.frame8.level5 {left fill expand} \
  366.               .xfOptionsSource.frame8.level6 {left fill expand} \
  367.               .xfOptionsSource.frame8.level7 {left fill expand} \
  368.               .xfOptionsSource.frame8.level8 {left fill expand}
  369.   pack append .xfOptionsSource \
  370.               .xfOptionsSource.frame1 {bottom fill} \
  371.               .xfOptionsSource.frame2 {top fill} \
  372.               .xfOptionsSource.frame3 {top fill} \
  373.               .xfOptionsSource.frame7 {top fill} \
  374.               .xfOptionsSource.frame8 {top fill} \
  375.               .xfOptionsSource.frame4 {top fill expand}
  376. }
  377.  
  378. ##########
  379. # Procedure: XFOptionsSourceComment
  380. # Description: set the comment value
  381. # Arguments: none
  382. # Returns: none
  383. # Sideeffects: none
  384. ##########
  385. proc XFOptionsSourceComment {} {
  386.   global xfConf
  387.   global xfMisc
  388.   global xfStatus
  389.  
  390.   set xfMisc(comment$xfStatus(currentComment)) \
  391.     [XFMiscGetText .xfOptionsSource.frame4.text.text]
  392.   XFMiscSetText .xfOptionsSource.frame4.text.text \
  393.     [set xfMisc(comment$xfStatus(comment))]
  394.   set xfStatus(currentComment) $xfStatus(comment)
  395. }
  396.  
  397. ##########
  398. # Procedure: XFOptionsSourceSet
  399. # Description: set the new options
  400. # Arguments: none
  401. # Returns: none
  402. # Sideeffects: none
  403. ##########
  404. proc XFOptionsSourceSet {} {
  405.   global xfBindSaveLevel
  406.   global xfComment
  407.   global xfConf
  408.   global xfMisc
  409.   global xfPath
  410.   global xfProcSaveLevel
  411.   global xfStatus
  412.   global tkVersion
  413.  
  414.   set xfConf(encloseBinding) $xfMisc(encloseBinding)
  415.   set xfConf(encloseConfigure) $xfMisc(encloseConfigure)
  416.   set xfConf(createAppdefCode) $xfMisc(createAppdefCode)
  417.   set xfConf(createClassBinding) $xfMisc(createClassBinding)
  418.   set xfConf(createFormCode) $xfMisc(createFormCode)
  419.   set xfConf(createParseCode) $xfMisc(createParseCode)
  420.   set xfConf(createPixmapCode) $xfMisc(createPixmapCode)
  421.   if {$tkVersion >= 3.3} {
  422.     set xfConf(newPacker) $xfMisc(newPacker)
  423.   } {
  424.     set xfConf(newPacker) 0
  425.   }
  426.   if {$xfConf(newPacker)} {
  427.     source "$xfPath(src)/xfpackingNew.tcl"
  428.   } {
  429.     source "$xfPath(src)/xfpacking.tcl"
  430.   }
  431.   set xfConf(writeShellScript) $xfMisc(writeShellScript)
  432.   set xfConf(writeTclIndex) $xfMisc(writeTclIndex)
  433.   set xfConf(writeNewTclIndex) $xfMisc(writeNewTclIndex)
  434.   if {$xfConf(writeNewTclIndex)} {
  435.     set xfConf(writeTclIndex) 1
  436.   }
  437.   set xfMisc(comment$xfStatus(currentComment)) \
  438.     [XFMiscGetText .xfOptionsSource.frame4.text.text]
  439.   set xfComment(file) $xfMisc(commentfile)
  440.   set xfComment(module) $xfMisc(commentmodule)
  441.   set xfComment(proc) $xfMisc(commentproc)
  442.   set xfComment(template) $xfMisc(commenttemplate)
  443.   set xfBindSaveLevel(1) $xfMisc(bindSaveLevel1)
  444.   set xfBindSaveLevel(2) $xfMisc(bindSaveLevel2)
  445.   set xfBindSaveLevel(3) $xfMisc(bindSaveLevel3)
  446.   set xfBindSaveLevel(4) $xfMisc(bindSaveLevel4)
  447.   set xfBindSaveLevel(5) $xfMisc(bindSaveLevel5)
  448.   set xfBindSaveLevel(6) $xfMisc(bindSaveLevel6)
  449.   set xfBindSaveLevel(7) $xfMisc(bindSaveLevel7)
  450.   set xfBindSaveLevel(8) $xfMisc(bindSaveLevel8)
  451.   set xfProcSaveLevel(1) $xfMisc(procSaveLevel1)
  452.   set xfProcSaveLevel(2) $xfMisc(procSaveLevel2)
  453.   set xfProcSaveLevel(3) $xfMisc(procSaveLevel3)
  454.   set xfProcSaveLevel(4) $xfMisc(procSaveLevel4)
  455.   set xfProcSaveLevel(5) $xfMisc(procSaveLevel5)
  456.   set xfProcSaveLevel(6) $xfMisc(procSaveLevel6)
  457.   set xfProcSaveLevel(7) $xfMisc(procSaveLevel7)
  458.   set xfProcSaveLevel(8) $xfMisc(procSaveLevel8)
  459. }
  460.  
  461. # eof
  462.  
  463.